import { createRouter, createWebHistory } from 'vue-router'
import UserLoginPage from '@/pages/user/UserLoginPage.vue'
import HomePage from '@/pages/HomePage.vue'
import UserRegisterPage from '@/pages/user/UserRegisterPage.vue'
import UserManagePage from '@/pages/admin/UserManagePage.vue'
import PictureAddPage from '@/pages/picture/PictureAddPage.vue'
import PictureManagePage from '@/pages/admin/PictureManagePage.vue'
import PictureInfoPage from '@/pages/picture/PictureInfoPage.vue'
import PictureBatchAddPage from '@/pages/admin/PictureBatchAddPage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', name: '主页', component: HomePage, },
    { path: '/user/login', name: '用户登录', component: UserLoginPage, },
    { path: '/user/register', name: '用户注册', component: UserRegisterPage, },
    { path: '/admin/userManage', name: '用户管理', component: UserManagePage, },
    { path: '/admin/pictureManage', name: '图片管理', component: PictureManagePage, },
    { path: '/picture/add', name: '创建图片', component: PictureAddPage, },
    { path: '/picture/add/batch', name: '批量创建图片', component: PictureBatchAddPage, },
    { path: '/picture/:id', name: '图片详情', component: PictureInfoPage, props: true,  },
  ],
})

export default router
